package com.aiyige.utils;

import org.greenrobot.eventbus.EventBus;

public class EventBusUtil {

    public static void registerGlobalEventBus(Object o) {
        try {
            if (!EventBus.getDefault().isRegistered(o)) {
                EventBus.getDefault().register(o);
            }
        } catch (Exception e) {

        }
    }

    public static void unregisterGlobalEventBus(Object o) {
        try {
            if (EventBus.getDefault().isRegistered(o)) {
                EventBus.getDefault().unregister(o);
            }
        } catch (Exception e) {

        }
    }
}
